package pojo;

import java.util.Collection;
import java.util.Objects;

public class TbPhone {
    private Integer phoneId;
    private String phoneName;
    private Double phoneOldPrice;
    private String phonePic;
    private Integer phoneBrandId;
    private TbBrand tbBrandByPhoneBrandId;
    private Collection<TbPhonePriceDetail> tbPhonePriceDetailsByPhoneId;

    public Integer getPhoneId() {
        return phoneId;
    }

    public void setPhoneId(Integer phoneId) {
        this.phoneId = phoneId;
    }

    public String getPhoneName() {
        return phoneName;
    }

    public void setPhoneName(String phoneName) {
        this.phoneName = phoneName;
    }

    public Double getPhoneOldPrice() {
        return phoneOldPrice;
    }

    public void setPhoneOldPrice(Double phoneOldPrice) {
        this.phoneOldPrice = phoneOldPrice;
    }

    public String getPhonePic() {
        return phonePic;
    }

    public void setPhonePic(String phonePic) {
        this.phonePic = phonePic;
    }

    public Integer getPhoneBrandId() {
        return phoneBrandId;
    }

    public void setPhoneBrandId(Integer phoneBrandId) {
        this.phoneBrandId = phoneBrandId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TbPhone tbPhone = (TbPhone) o;
        return Objects.equals(phoneId, tbPhone.phoneId) &&
                Objects.equals(phoneName, tbPhone.phoneName) &&
                Objects.equals(phoneOldPrice, tbPhone.phoneOldPrice) &&
                Objects.equals(phonePic, tbPhone.phonePic) &&
                Objects.equals(phoneBrandId, tbPhone.phoneBrandId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(phoneId, phoneName, phoneOldPrice, phonePic, phoneBrandId);
    }

    public TbBrand getTbBrandByPhoneBrandId() {
        return tbBrandByPhoneBrandId;
    }

    public void setTbBrandByPhoneBrandId(TbBrand tbBrandByPhoneBrandId) {
        this.tbBrandByPhoneBrandId = tbBrandByPhoneBrandId;
    }

    public Collection<TbPhonePriceDetail> getTbPhonePriceDetailsByPhoneId() {
        return tbPhonePriceDetailsByPhoneId;
    }

    public void setTbPhonePriceDetailsByPhoneId(Collection<TbPhonePriceDetail> tbPhonePriceDetailsByPhoneId) {
        this.tbPhonePriceDetailsByPhoneId = tbPhonePriceDetailsByPhoneId;
    }
}
